package com.chenwut.Exercise;

import java.util.Scanner;

public class Exercise3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
//            System.out.println(jiecheng(i)+"  ");
            sum += jiecheng(i);
        }
        System.out.println(sum);
    }


    public static int jiecheng(int n) {
        int temp = 1;
        for (int i = 1; i <= n; i++) {
            temp *= i;
        }
        return temp;
    }

}
